package com.atguigu06.polymorphism.ex4;

public class Exer4 {
    public static void main(String[] args) {
       // Exer4 exer4=new Exer4();
        Man m1=new Man();
        Woman w1=new Woman();
        meeting(m1,w1,new Man());

    }
    
    public static  void meeting(Person...ps){//相当于是一个数组！！！！！！！！！！！
        for (int i = 0; i <ps.length ; i++) {
            ps[i].eat();
            ps[i].toilet();
            if (ps[i] instanceof Man){
                Man man=(Man)ps[i] ;
                man.smoke();
            }
            if (ps[i] instanceof Woman){
                Woman woman =(Woman)ps[i];
                woman.makeup();
            }
        }
    }
}
